<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('招募团队文案列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                添加人名称：
                                <input type="text" name="realName"/>
                            </li>
                            <li>
                                发布状态：
                                <select name="is_publish">
                                    <option value="">所有</option>
                                    <option value="0" name="is_publish">未发布</option>
                                    <option value="1" name="is_publish">已发布</option>
                                </select>
                            </li>
                            <li>
                                标题：
                                <input type="text" name="title"/>
                            </li>
                            <li class="select-time">
                                <label>创建时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add(800,1100)" shiro:hasPermission="recruitTeam:recruitTeam:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="recruitTeam:recruitTeam:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->

            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var datas = [[${@dict.getType('publish_type')}]];
        var editFlag = [[${@permission.hasPermi('recruitTeam:recruitTeam:edit')}]];
        var removeFlag = [[${@permission.hasPermi('recruitTeam:recruitTeam:remove')}]];
        var prefix = ctx + "recruitTeam/recruitTeam";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "招募团队文案",
                clickToSelect:true,
                columns: [{
                    radio: true
                },
                    {
                        field: 'id',
                        title: 'id',
                        visible: false
                    },
                {
                    field: 'adminId',
                    title: '用户编号'
                },
                    {
                        field: 'title',
                        title: '标题',
                        formatter:function (value, row, index) {
                            return $.table.tooltip(value,6);
                        }
                    },
                    {
                        field: 'type',
                        title: '文案类型',
                        formatter: function (value, row, index) {
                            if (value == '0') {
                                return '<span class="label label-danger">钱展业端管理</span>';
                            } else if (value == '1') {
                                return '<span class="label label-success">商钱付</span>';
                            }
                        }
                    },
                    {
                        field: 'imgUrl',
                        title: '封面图',
                        formatter: function(value, row, index) {
                            return $.table.imageView(value);
                        }
                    },
                {
                    field: 'is_publish',
                    title: '发布状态',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'realName',
                    title: '添加人名称'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'msg',
                    title: '消息内容',
                    formatter:function (value, row, index) {
                        return $.table.tooltip(value,6);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\',800,1100)"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\',800,1100)"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>